Method for managing multi-channel memory device to have improved channel switch response time and related memory control system

ABSTRACT

A method for managing a multi-channel memory device includes at least following steps: when the multi-channel memory device is controlled to operate in an M-channel mode, reserving a partial memory space across N memory channels of the multi-channel memory device, where the reserved partial memory space is not used under the M-channel mode, M and N are positive integers, and M is smaller than N; and when the multi-channel memory device is controlled to switch from the M-channel mode to an N-channel mode, accessing data in the reserved partial memory space across the N memory channels used under the N-channel mode. The method for managing a multi-channel memory device can improve switch response time.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. provisional application No.62/037,842, filed on Aug. 15, 2014 and incorporated herein by reference.

TECHNICAL FIELD

The disclosed embodiments of the present invention relate to accessing amemory device, and more particularly, to a method for managing amulti-channel memory device to have improved channel switch responsetime and a related memory control system.

BACKGROUND

Computer technology continues to advance at a remarkable pace, withnumerous improvements being made to the performance of both of theprocessor system and the memory system in a computer system. Forexample, in response to demands for faster, more efficient computersystems, the processor system may be designed to have higher computingpower and operate more quickly for dealing with more tasks. If theoperating capability of the memory system fails to meet the bandwidthrequirement, the memory system would become a performance bottleneck.Hence, attention has been directed to increasing throughput of thememory system.

A multi-channel memory device may be employed to meet the bandwidthrequirement. Taking a dual-channel memory device for example, it has twoparallel memory channels operating simultaneously to thereby offerlarger data throughput. When the number of memory channels used in themulti-channel memory device is larger, it means the power consumption ishigher. Further, the computer system does not always need a large memorybandwidth. When the multi-channel memory device has all of its memorychannels active under a condition that the computer system only needs asmaller memory bandwidth, the power utilization may not be optimized. Ifthe computer system is a portable device (e.g., a smartphone) powered bya battery device, the battery life may be shortened due to increasedpower consumption of the memory system. Thus, there is a need for aninnovative design which can effectively manage a multi-channel memory toswitch between a low power consumption mode and a high memory bandwidthmode.

SUMMARY

In accordance with exemplary embodiments of the present invention, amethod for managing a multi-channel memory device to have improvedchannel switch response time and a related memory control system areproposed.

According to a first aspect of the present invention, an exemplarymethod for managing a multi-channel memory device is disclosed. Theexemplary method includes: when the multi-channel memory device iscontrolled to operate in an M-channel mode, reserving a partial memoryspace across N memory channels of the multi-channel memory device,wherein the reserved partial memory space is not used under theM-channel mode, M and N are positive integers, and M is smaller than N;and when the multi-channel memory device is controlled to switch fromthe M-channel mode to an N-channel mode, accessing data in the reservedpartial memory space across the N memory channels used under theN-channel mode.

According to a second aspect of the present invention, an exemplarymethod for managing a multi-channel memory device is disclosed. Theexemplary method includes: when the multi-channel memory device iscontrolled to switch from an M-channel mode to an N-channel mode,controlling data of at least one first memory region in a partial memoryspace at M memory channels used under the M-channel mode to migrate to apartial memory space at L memory channels not used under the M-channelmode before controlling data of at least one second memory region in thepartial memory space at the M memory channels used under the M-channelmode to migrate to the partial memory space at the L memory channels notused under the M-channel mode, wherein M, L and N are positive integersand M is smaller than N; and a bandwidth requirement associated with theat least one first memory region is higher than a bandwidth requirementassociated with the at least one second memory region.

According to a third aspect of the present invention, an exemplarymemory control system for managing a multi-channel memory device isdisclosed. The exemplary memory control system includes a modecontrolling module and a memory access controlling circuit. The modecontrolling module is arranged to control the multi-channel memorydevice to operate in an M-channel mode and control the multi-channelmemory device to switch from the M-channel mode to an N-channel mode,wherein M and N are positive integers, and M is smaller than N. When themulti-channel memory device is controlled to operate in the M-channelmode, the memory access controlling circuit is arranged to reserve apartial memory space across N memory channels of the multi-channelmemory device, where the reserved partial memory space is not used underthe M-channel mode; and when the multi-channel memory device iscontrolled to switch from the M-channel mode to the N-channel mode, thememory access controlling circuit is arranged to perform data access inthe reserved partial memory space across the N memory channels usedunder the N-channel mode.

According to a fourth aspect of the present invention, an exemplarymemory control system for managing a multi-channel memory device isdisclosed. The exemplary memory control system includes a modecontrolling module and a memory access controlling circuit. The modecontrolling module is arranged to control the multi-channel memorydevice to switch from an M-channel mode to an N-channel mode, wherein Mand N are positive integers, and M is smaller than N. When themulti-channel memory device is controlled to switch from the M-channelmode to the N-channel mode, the memory access controlling circuit isarranged to control data of at least one first memory region in apartial memory space at M memory channels used under the M-channel modeto migrate to a partial memory space at L memory channels not used underthe M-channel mode before controlling data of at least one second memoryregion in the partial memory space at the M memory channels used underthe M-channel mode to migrate to the partial memory space at the Lmemory channels not used under the M-channel mode, where L is a positiveinteger, and a bandwidth requirement associated with the at least onefirst memory region is higher than a bandwidth requirement associatedwith the at least one second memory region.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a memory system according to anembodiment of the present invention.

FIG. 2 is a diagram illustrating an example of managing a multi-channelmemory device according to a first embodiment of the present invention.

FIG. 3 is a diagram illustrating an example of managing a multi-channelmemory device according to a second embodiment of the present invention.

FIGS. 4-5 are diagrams illustrating an example of managing amulti-channel memory device according to a third embodiment of thepresent invention.

DETAILED DESCRIPTION

Certain terms are used throughout the description and following claimsto refer to particular components. As one skilled in the art willappreciate, manufacturers may refer to a component by different names.This document does not intend to distinguish between components thatdiffer in name but not function. In the following description and in theclaims, the terms “include” and “comprise” are used in an open-endedfashion, and thus should be interpreted to mean “include, but notlimited to . . . ”. Also, the term “couple” is intended to mean eitheran indirect or direct electrical connection. Accordingly, if one deviceis coupled to another device, that connection may be through a directelectrical connection, or through an indirect electrical connection viaother devices and connections.

The present invention proposes a memory system design which can changethe number of active memory channels used in a multi-channel memorydevice without degrading the user experience of using a computer system.For example, the data migration may be performed to make stored datamigrated from a second memory space at a second memory channel to afirst memory space at a first memory channel. If the second memory spacehas no valid data after the data migration is accomplished, the secondmemory channel and/or associated memory controller may be powered downor may enter the power-saving mode (e.g., self-refresh mode or otheroperation mode with power consumption lower than the normal mode) forpower saving. Further, since the number of memory channels active at thesame time may be reduced after the data migration is accomplished, thememory controllers may not need to control data access via all of thememory channels simultaneously. The power consumption can be reducedcorrespondingly. If the computer system demands more memory bandwidthunder certain scenarios, the multi-channel memory device may becontrolled to have channel switch to support a larger memory bandwidth.Hence, the data migration may be performed to make stored data migratedfrom the first memory space at the first memory channel to the secondmemory space at the second memory channel, thus enabling simultaneousdata access of the first memory space at the first memory channel andthe second memory space at the second memory channel. However, therequired memory bandwidth may not be immediately available due to thetime-consuming data migration. The present invention therefore proposesan innovative memory system design which can provide effective memorybandwidth within a shorter channel switch time. In this way, channelswitch may be performed without user-aware data migration latency. Thatis, the user of the computer system may not easily perceive the systemresponse delay caused by the channel switch operation. Further detailsof the proposed memory system design are described as below.

FIG. 1 is a block diagram illustrating a memory system according to anembodiment of the present invention. The memory system 100 may be partof a computer system. For example, the memory system 100 may beimplemented in a portable device, such as a tablet, a smartphone, or awearable device. The memory system 100 may include a memory controlsystem 101 and a multi-channel memory device (e.g., a dynamic randomaccess memory) 102. The memory control system 101 may include a memoryaccess controlling circuit 103 and a mode controlling module 108, wherethe memory access controlling circuit 103 may include a plurality ofmemory controllers 104_1-104_K and a direct memory access (DMA)controller 106. The mode controlling module 108 may be implemented usingdedicated hardware, or may be implemented using software or firmwarerunning on a processor. In this embodiment, the multi-channel memorydevice 102 may have a plurality of memory areas 110_1-110_K accessed viaa plurality of memory channels 109_1-109_K, respectively. The memorycontrollers 104_1-104_K may be configured to control data access (i.e.,read and write) of the memory areas 110_1-110_K, respectively. Hence,the number of memory controllers 104_1-104_K may be equal to the numberof memory areas 110_1-110_K, and may also be equal to the number ofmemory channels 109_1-109_K. Alternatively, the number of memorycontroller may be smaller than the number of memory areas, and may alsobe smaller than the number of memory channels. That is, one memorycontroller may be configured to control data access (i.e., read andwrite) of more than one memory area via more than one memory channel.This also falls within the scope of the present invention.

It should be noted that value of K may be any positive number notsmaller than two. In other words, the value of K may be adjusted,depending upon actual design considerations. For example, when K=2, adual-channel memory device may be employed. For another example, whenK=4, a quad-channel memory device may be employed. Each of the memoryareas 110_1-110_K may have a plurality of memory regions 112 addressedby different memory addresses. The multi-channel memory device 102 mayinclude one or more memory dies/chips. In one embodiment, each of thememory areas 110_1-110_K may include one or more memory dies/chips.

The memory system 100 may be used by one or more high bandwidth engines10 and one or more low bandwidth engines 12 for data storage, where abandwidth requirement of each high bandwidth engine 10 may be higherthan a bandwidth requirement of each low bandwidth engine 12. In thisembodiment, the mode controlling module 108 may be arranged to check asystem load status and/or a display screen on/off status to determine ifa computer system using the memory system 100 demands a higher memorybandwidth (e.g., heavy system load and/or turned-on display screen) or alower memory bandwidth (e.g., light system load and/or turned-offdisplay screen), and may refer to a checking result to control themulti-channel memory device 102 to operate in one of a plurality ofdifferent modes, including an M-channel mode (e.g., low powerconsumption/memory bandwidth mode) and an N-channel mode (e.g., highpower consumption/memory bandwidth mode). The values of M and N may bepositive integers (i.e., M≥1 and N≥1), the value of M may be smallerthan the value of N, and the value of N may be smaller than or equal tothe value of K. In one exemplary design, the value of N may be equal tothe value of K and may be an integer multiple of the value of M. Forexample, N=K=4 and M=2.

In other words, the mode controlling module 108 may control themulti-channel memory device 102 to switch between operation modes withdifferent active memory channel numbers. For example, when the computersystem using the memory system 100 does not demand a high memorybandwidth, the mode controlling module 108 may enable the M-channel modeby disabling (e.g. powering down) a portion of the memory channels109_1-109_K and associated memory controllers 104_1-104_K, thus onlyallowing M memory channels and associated M memory controllers to beactive. In this way, the power consumption of the memory system 100 canbe effectively reduced. For another example, when the computer systemusing the memory system 100 demands a high memory bandwidth, the modecontrolling module 108 may enable the N-channel mode by enabling more ofthe memory channels 109_1-109_K and more of associated memorycontrollers 104_1-104_K, thus allowing N memory channels and associatedN memory controllers to be active. In this way, the memory device 102may meet the high bandwidth requirement.

With regard to the DMA controller 106, it may be used to act as a datamigration control circuit for perform the data migration in response tothe channel switch operation. The DMA controller 106 may control datamigration of stored data in a DMA manner. Hence, the DMA controller 106may perform the data migration to make stored data migrated from apartial memory space at a second memory channel to a partial memoryspace at a first memory channel when the memory system 100 is requiredto operate under a first channel number, and the DMA controller 106 mayperform the data migration to make stored data migrated from the partialmemory space at the first memory channel to the partial memory space atthe second memory channel when the memory system 100 is required tooperate under a second channel number different from the first channelnumber. In this embodiment, the DMA controller 106 and the modecontrolling module 108 are shown as separate functional blocks.Alternatively, the DMA controller 106 may be integrated with the modecontrolling module 108. That is, a single circuit may be configured toperform functions of the mode controlling module 108 and the DMAcontroller 106.

As mentioned above, when the multi-channel memory device is controlledto switch from the M-channel mode to the N-channel mode, the requiredmemory bandwidth may not be immediately available due to thetime-consuming data migration. The present invention therefore proposesan innovative memory management design which can provide effectivememory bandwidth within a shorter channel switch time. For betterunderstanding of technical features of the present invention, severalexamples of managing the multi-channel memory device 102 to haveimproved channel switch response time are detailed as below. For clarityand simplicity, the following assumes that N=K=4 and M=2. However, thisis for illustrative purposes only, and is not meant to be a limitationof the present invention. That is, the same concept may be applied todifferent multi-channel memory devices. These alternative designs allfall within the scope of the present invention.

FIG. 2 is a diagram illustrating an example of managing themulti-channel memory device 102 according to a first embodiment of thepresent invention. As shown in FIG. 2, the multi-channel memory device102 may include four memory areas 110_1-110_K (K=4) that may be accessedvia four memory channels 109_1-109_K (K=4). When the multi-channelmemory device 102 is controlled to operate under an M-channel mode(e.g., dual-channel mode with M=2), the memory areas 110_1-110_2 and theassociated memory channels 109_1-109_2 may be active, while the memoryareas 110_3-110_4 and the associated memory channels 109_3-109_4 may bedisabled (e.g. powered down) or may enter the power-saving mode (e.g.,self-refresh mode or other operation mode with power consumption lowerthan the normal mode). That is, the multi-channel memory device 102 maybe partially active under the M-channel mode (i.e., dual-channel modewith M=2). When the multi-channel memory device 102 is controlled tooperate under an N-channel mode (e.g., quad-channel mode withN=K=4=2×M), the memory areas 110_1-110_4 and the associated memorychannels 109_1-109_4 may be active. That is, the multi-channel memorydevice 102 may be fully active under the N-channel mode (e.g.,quad-channel mode with N=K=4=2×M).

As shown in FIG. 2, the memory area 110_1 may include a plurality ofmemory regions R0, R4, R8, . . . , R92; the memory area 110_2 mayinclude a plurality of memory regions R1, R5, R9, . . . , R93; thememory area 110_3 may include a plurality of memory regions R2, R6, R10,. . . , R94; and the memory area 110_4 may include a plurality of memoryregions R3, R7, R11, . . . , R95. When the multi-channel memory device102 is controlled to operate under an N-channel mode (e.g., quad-channelmode with N=K=4=2×M), a quad-channel memory space composed of memoryregions R0-R35 may be used in the quad-channel mode, where four memoryregions may be accessed in parallel according to a memory address setcomposed of a plurality of memory addresses. With regard to thequad-channel mode, each memory address set may include four adjacentmemory addresses that may be equally spaced by the same offset, wherethe offset may be adjusted, depending upon the actual designconsideration. For example, four memory regions R0-R3 may be accessed byusing a memory address set composed of a plurality of memory addresses(e.g., four adjacent memory addresses that may be equally spaced by thesame offset), four memory regions R4-R7 may be accessed by using amemory address set composed of a plurality of memory addresses (e.g.,four adjacent memory addresses that may be equally spaced by the sameoffset), and four memory regions R8-R11 may be accessed by using amemory address set composed of a plurality of memory addresses (e.g.,four adjacent memory addresses that may be equally spaced by the sameoffset). Hence, data D0-D35 may be accessed in the memory regionsR0-R35, respectively.

When the multi-channel memory device 102 is controlled to switch fromthe N-channel mode (e.g., quad-channel mode with N=K=4=2×M) to theM-channel (e.g., dual-channel mode with M=2), valid data in one partialmemory space at L memory channels (which may be across the memorychannels 109_3 and 109_4 and may be composed of memory regions R2, R3,R6, R7, . . . , R34, R35, if L is a positive integer such as 2) may becontrolled by the memory access controlling circuit 103 (particularly,DMA controller 106) to migrate to another partial memory space at Mmemory channels (which may be across the memory channels 109_1 and 109_2and may be composed of memory regions R36, R37, R40, R41, . . . , R68,R69, if M=2). For example, assuming that all of the stored data D2, D3,D6, D7, . . . , D34, D35 in the memory regions R2, R3, R6, R7, . . . ,R34, R35 may be valid data, the stored data D2, D3, D6, D7, . . . , D34,D35 may be controlled to migrate to the memory regions R36, R37, R40,R41, . . . , R68, R69, as shown in the left part of FIG. 2. With regardto the dual-channel mode, each memory address set may include twoadjacent memory addresses that may be equally spaced by the same offset,where the offset may be adjusted, depending upon the actual designconsideration. As a result, a group of data D0, D1, D2, D3 may beaccessed by using two different memory address sets, including onememory address set directed to memory regions R0 and R1 and the othermemory address set directed to the memory regions R36 and R37.Similarly, a group of data D4, D5, D6, D7 may be accessed by using twodifferent memory address sets, including one memory address set directedto memory regions R4 and R5 and the other memory address set directed tothe memory regions R40 and R41; and a group of data D32, D33, D34, D35may be accessed by using two different memory address sets, includingone memory address set directed to memory regions R32 and R33 and theother memory address set directed to the memory regions R68 and R69.

In this embodiment, when the multi-channel memory device 102 iscontrolled to operate in the M-channel mode (e.g., dual-channel modewith M=2), a partial memory space 202 (which may be across the memorychannels 109_1-109_4 and may be composed of memory regions R72-R95) isreserved by the memory access controlling circuit 103. The partialmemory space 202 may be blocked from being used under the M-channel mode(e.g., dual-channel mode with M=2), and may be allowed to be used underthe N-channel mode (e.g., quad-channel mode with N=4). The reservedpartial memory space 202 may have no valid data stored therein when themulti-channel memory device 102 is controlled to operate in theM-channel mode (e.g., dual-channel mode with M=2). Since the reservedpartial memory space 202 is empty at the time the N-channel mode (e.g.,quad-channel mode with N=4) is enabled, the reserved partial memoryspace 202 may be ready to satisfy the high memory bandwidth requirement.For example, the reserved partial memory space 202 may be ready to servememory access requests issued from high bandwidth engines 12.

For example, before, when or after the multi-channel memory device 102is controlled to switch from the N-channel mode (e.g., quad-channel modewith N=4) to the M-channel mode (e.g., dual-channel mode with M=2), datamigration may be performed upon the partial memory space 202, such thatany valid data in the partial memory space 202 is controlled to migrateto a partial memory space composed of unused memory regions such as R36,R37, R40, R41, . . . , R68, R69. In this way, the partial memory space202 may become an empty partial memory space when the multi-channelmemory device 102 is controlled to operate in the M-channel mode (e.g.,dual-channel mode with M=2).

When the multi-channel memory device 102 is controlled to switch fromthe M-channel mode (e.g., dual-channel mode with M=2) to the N-channelmode (e.g., quad-channel mode with N=4), the memory access controllingcircuit 103 may perform data access in the reserved partial memory space202 for satisfying the high memory bandwidth requirement (e.g., memoryaccess requests issued from the high bandwidth engines 10). By way ofexample, but not limitation, the high bandwidth engines 10 may include adisplay engine for processing image data stored in the multi-channelmemory device and driving a display screen, a processing engine forprocessing a camera output and storing the processed camera output intothe multi-channel memory device, etc. In other words, when themulti-channel memory device 102 is controlled to switch from theM-channel mode (e.g., dual-channel mode with M=2) to the N-channel mode(e.g., quad-channel mode with N=4), the mode controlling module 108 mayinstruct a first engine (e.g., high bandwidth engine 10) to access datain the reserved partial memory space 202 across the memory channels109_1-109_4, and may not instruct a second engine (e.g., low bandwidthengine 12) to access data in the reserved partial memory space 202across the memory channels 109_1-109_4, where a bandwidth requirement ofthe first engine is higher than a bandwidth requirement of the secondengine.

In addition, when the multi-channel memory device 102 is controlled toswitch from the M-channel mode (e.g., dual-channel mode with M=2) to theN-channel mode (e.g., quad-channel mode with N=4), valid data in onepartial memory space at M memory channels (which may be across thememory channels 109_1 and 109_2 and may be composed of memory regionsR36, R37, R40, R41, . . . , R68, R69, if M=2) may be controlled by thememory access controlling circuit 103 (particularly, DMA controller 106)to migrate to another partial memory space at L memory channels (whichmay be across the memory channels 109_3 and 109_4 and may be composed ofmemory regions R2, R3, R6, R7, . . . , R34, R35, if L=2). Consider acase where data D18 and D19 stored in the memory regions R52 and R53does not migrate to the memory regions R18 and R19 yet, and a group ofdata D16, D17, D18, D19 stored in the memory regions R16, R17, R52, R53is requested by a high bandwidth engine 10. The high bandwidth engine 10may first access old data D16, D17, D18, D19 stored in the memoryregions R16, R17, R52, R53 at two memory address sets Addr1 and Addr2,and then access following data D16, D17, D18, D19 in the memory regionsR72, R73, R74, R75 at a single memory address set Addr3, as illustratedin the right part of FIG. 2. Consider another case where data D16, D17,D18, D19 stored in the memory regions R16, R17, R52, R53 may becontrolled to migrate to the reserved partial memory space 202 at thetime the M-channel mode (e.g., dual-channel mode with M=2) is switchedto the N-channel mode (e.g., quad-channel mode with N=4), the highbandwidth engine 10 may access the requested data D16, D17, D18, D19 atthe single memory address set Addr3. In another example, the data D16,D17, D18, D19 may be copied to the reserved partial memory space 202before or when the M-channel mode (e.g., dual-channel mode with M=2) isswitched to the N-channel mode (e.g., quad-channel mode with N=4), sothat the high bandwidth engine 10 may access the requested data D16,D17, D18, D19 at the reserved partial memory space 202.

It should be noted that the memory access controlling circuit 103 mayperform data access in the reserved partial memory space 202 across theN memory channels used under the N-channel mode while controlling dataof one partial memory space at M memory channels used under theM-channel mode to migrate to another partial memory space at L memorychannels not used under the M-channel mode, where M, N and L may bepositive integers, and the M memory channels and the L memory channelsmay be included in the N memory channels. Though the data migration forstored data is not complete yet, the high bandwidth engine 10 may getthe desired memory bandwidth provided by the reserved partial memoryspace 202 in a short time.

FIG. 3 is a diagram illustrating an example of managing themulti-channel memory device 102 according to a second embodiment of thepresent invention. As shown in FIG. 3, the multi-channel memory device102 may include four memory areas 110_1-110_K (K=4) that may be accessedvia four memory channels 109_1-109_K (K=4). When the multi-channelmemory device 102 is controlled to operate under an M-channel mode(e.g., dual-channel mode with M=2), the memory areas 110_1-110_2 and theassociated memory channels 109_1-109_2 may be active, while the memoryareas 110_3-110_4 and the associated memory channels 109_3-109_4 may bedisabled (e.g. powered down) or may enter the power-saving mode (e.g.,self-refresh mode or other operation mode with power consumption lowerthan the normal mode). That is, the multi-channel memory device 102 maybe partially active under the M-channel mode (e.g., dual-channel modewith M=2). When the multi-channel memory device 102 is controlled tooperate under an N-channel mode (e.g., quad-channel mode withN=K=4=2×M), the memory areas 110_1-110_4 and the associated memorychannels 109_1-109_4 may be active. That is, the multi-channel memorydevice 102 may be fully active under the N-channel mode (e.g.,quad-channel mode with N=K=4=2×M).

As shown in FIG. 3, the memory area 110_1 may include a plurality ofmemory regions R0, R4, R8, . . . , R92; the memory area 110_2 mayinclude a plurality of memory regions R1, R5, R9, . . . , R93; thememory area 110_3 may include a plurality of memory regions R2, R6, R10,. . . , R94; and the memory area 110_4 may include a plurality of memoryregions R3, R7, R11, . . . , R95. In this embodiment, a quad-channelmemory space composed of memory regions R0-R47 may be used in thequad-channel mode, where four memory regions may be accessed in parallelaccording to a memory address set. With regard to the quad-channel mode,each memory address set may include four adjacent memory addresses thatmay be equally spaced by the same offset, where the offset may beadjusted, depending upon the actual design consideration. For example,four memory regions R0-R3 may be accessed by using a memory address set,four memory regions R4-R7 may be accessed by using a memory address set,and four memory regions R8-R11 may be accessed by using a memory addressset. Hence, when the multi-channel memory device 102 is controlled tooperate in the N-channel mode (e.g., quad-channel mode with N=4), dataD0-D47 may be accessed in the memory regions R0-R47, respectively.

When the multi-channel memory device 102 is controlled to switch fromthe N-channel mode (e.g., quad-channel mode with N=4) to the M-channelmode (e.g., dual-channel mode with M=2), valid data in one partialmemory space at L memory channels (which may be across the memorychannels 109_3 and 109_4 and may be composed of memory regions R2, R3,R6, R7, . . . , R46, R47, if L=2) may be controlled by the memory accesscontrolling circuit 103 (particularly, DMA controller 106) to migrate toanother partial memory space at M memory channels (which may be acrossthe memory channels 109_1 and 109_2 and may be composed of memoryregions R48, R49, R52, R53, . . . , R92, R93, if M=2). For example,assuming that all of the stored data D2, D3, D6, D7, . . . , D46, D47 inthe memory regions R2, R3, R6, R7, . . . , R46, R47 may be valid data,the stored data D2, D3, D6, D7, . . . , D46, D47 may be controlled tomigrate to the memory regions R48, R49, R52, R53, . . . , R92, R93, asshown in the left part of FIG. 3. With regard to the dual-channel mode,each memory address set may include two adjacent memory addresses thatmay be equally spaced by the same offset, where the offset may beadjusted, depending upon the actual design consideration. As a result, agroup of data D0, D1, D2, D3 may be accessed by using two differentmemory address sets, including one memory address set directed to memoryregions R0 and R1 and the other memory address set directed to thememory regions R48 and R49. Similarly, a group of data D4, D5, D6, D7may be accessed by using two different memory address sets, includingone memory address set directed to memory regions R4 and R5 and theother memory address set directed to the memory regions R52 and R53; anda group of data D44, D45, D46, D47 may be accessed by using twodifferent memory address sets, including one memory address set directedto memory regions R44 and R45 and the other memory address set directedto the memory regions R92 and R93.

In this embodiment, when the multi-channel memory device 102 iscontrolled to operate in the M-channel mode (e.g., dual-channel modewith M=2), the memory access controlling circuit 103 may record memoryaddresses of memory regions associated with a high memory bandwidthrequirement (e.g., memory regions accessed by high bandwidth engines 10and/or memory regions with access frequency higher than a threshold).For example, one group of data D8, D9, D10, D11 stored in the memoryregions R8, R9, R56, R57 and another group of data D12, D13, D14, D15stored in the memory regions R12, R13, R60, R61 may be accessed by onehigh bandwidth engine 10 under the M-channel mode (e.g., dual-channelmode with M=2); and one group of data D28, D29, D30, D31 stored in thememory regions R28, R29, R76, R77 and another group of data D32, D33,D34, D35 stored in the memory regions R32, R33, R80, R81 may be accessedby another high bandwidth engine 10 under the M-channel mode (e.g.,dual-channel mode with M=2). Hence, the memory address sets Addr5-Addr8,each composed of a plurality of memory addresses, may be recorded by theDMA controller 106 in an internal storage device (e.g., a static randomaccess memory, a register, etc.) or an external storage device (e.g., adynamic random access memory).

When the multi-channel memory device 102 is controlled to switch fromthe M-channel mode (e.g., dual-channel mode with M=2) to the N-channelmode (e.g., quad-channel mode with N=4), the memory access controllingcircuit 103 may control data of at least one first memory region in onepartial memory space at M memory channels (which may be composed ofmemory regions R48, R49, R52, R53, . . . , R92, R93 and may be across Mmemory channels 109_1, 109_2 used under the M-channel mode, if M=2) tomigrate to another partial memory space at L memory channels (which maybe composed of memory regions R2, R3, R6, R7, . . . , R46, R47 and maybe across L memory channels 109_3, 109_4 not used under the M-channelmode, if L=2) before controlling data of at least one second memoryregion in one partial memory space at M memory channels (which may becomposed of memory regions R48, R49, R52, R53, . . . , R92, R93 and maybe across M memory channels 109_1, 109_2 used under the M-channel mode,if M=2) to migrate to another partial memory space at L memory channels(which may be composed of memory regions R2, R3, R6, R7, . . . , R46,R47 and may be across another M memory channels 109_3, 109_4 not usedunder the M-channel mode, if L=2), where a bandwidth requirementassociated with the at least one first memory region is higher than abandwidth requirement associated with the at least one second memoryregion. For example, the at least one first memory region is accessed bya first engine (e.g., high bandwidth engine 10), the at least one secondmemory region is accessed by a second engine (e.g., low bandwidth engine12), and a bandwidth requirement of the first engine is higher than abandwidth requirement of the second engine.

As shown in the right part of FIG. 3, the memory access controllingcircuit 103 (particularly, DMA controller 106) may refer to the recordedmemory address sets Addr7-Addr8, each composed of a plurality of memoryaddresses, to perform data migration upon data D30, D31, D34, D35 storedin the memory regions R76, R77, R80, R81 addressed by the recordedmemory address sets Addr7-Addr8, and then may refer to the recordedmemory address sets Addr5-Addr6, each composed of a plurality of memoryaddresses, to perform data migration upon data D10, D11, D14, D15 storedin the memory regions R56, R57, R60, R61 addressed by the recordedmemory address sets Addr5-Addr6. Since the data D10-D11, D14-D15,D30-D31, D34-D35 at the memory address sets Addr5-Addr8 may be regardedas high bandwidth data, the data migration may move the high bandwidthdata prior to moving the low bandwidth data. In accordance with theproposed memory management design, the priority of performing datamigration upon memory regions associated with a high memory bandwidthrequirement (e.g., memory regions accessed by high bandwidth engines 10and/or memory regions with access frequency higher than a threshold) maybe higher than the priority of performing data migration upon memoryregions associated with a low memory bandwidth requirement (e.g., memoryregions accessed by low bandwidth engines 12 and/or memory regions withaccess frequency not higher than the threshold) when the multi-channelmemory device 102 is controlled to switch from the M-channel mode (e.g.,dual-channel mode with M=2) to the N-channel mode (e.g., quad-channelmode with N=4). In this way, the high bandwidth requirement may besatisfied in a short time. For example, the high bandwidth engine mayget the desired memory bandwidth in a short time.

FIG. 4 and FIG. 5 are diagrams illustrating an example of managing themulti-channel memory device 102 according to a third embodiment of thepresent invention. As shown in FIG. 4, the multi-channel memory device102 may include four memory areas 110_1-110_K (K=4) that may be accessedvia four memory channels 109_1-109_K (K=4). When the multi-channelmemory device 102 is controlled to operate under an M-channel mode(e.g., dual-channel mode with M=2), the memory areas 110_1-110_2 and theassociated memory channels 109_1-109_2 may be active, while the memoryareas 110_3-110_4 and the associated memory channels 109_3-109_4 may bedisabled (e.g. powered down) or may enter the power-saving mode (e.g.,self-refresh mode or other operation mode with power consumption lowerthan the normal mode). That is, the multi-channel memory device 102 maybe partially active under the M-channel mode (e.g., dual-channel modewith M=2). When the multi-channel memory device 102 is controlled tooperate under an N-channel mode (e.g., quad-channel mode withN=K=4=2×M), the memory areas 110_1-110_4 and the associated memorychannels 109_1-109_4 may be active. That is, the multi-channel memorydevice 102 may be fully active under the N-channel mode (e.g.,quad-channel mode with N=K=4=2×M).

As shown in FIG. 4, the memory area 110_1 may include a plurality ofmemory regions R0, R4, R8, . . . , R92; the memory area 110_2 mayinclude a plurality of memory regions R1, R5, R9, . . . , R93; thememory area 110_3 may include a plurality of memory regions R2, R6, R10,. . . , R94; and the memory area 110_4 may include a plurality of memoryregions R3, R7, R11, . . . , R95. In this embodiment, a quad-channelmemory space composed of memory regions R0-R47 may be used in thequad-channel mode, where four memory regions may be accessed in parallelaccording to a memory address set. With regard to the quad-channel mode,each memory address set may include four adjacent memory addresses thatmay be equally spaced by the same offset, where the offset may beadjusted, depending upon the actual design consideration. For example,four memory regions R0-R3 may be accessed by using a memory address set,four memory regions R4-R7 may be accessed by using a memory address set,and four memory regions R8-R11 may be accessed by using a memory addressset. Hence, when the multi-channel memory device 102 is controlled tooperate in the N-channel mode (e.g., quad-channel mode with N=4), dataD0-D47 may be accessed in the memory regions R0-R47, respectively.

When the multi-channel memory device 102 is controlled to switch fromthe N-channel mode (e.g., quad-channel mode with N=4) to the M-channelmode (e.g., dual-channel mode with M=2), valid data in one partialmemory space at L memory channels (which may be across the memorychannels 109_3 and 109_4 and may be composed of memory regions R2, R3,R6, R7, . . . , R46, R47, if L=2) may be controlled by the memory accesscontrolling circuit 103 (particularly, DMA controller 106) to migrate toanother partial memory space at M memory channels (which may be acrossthe memory channels 109_1 and 109_2 and may be composed of memoryregions R48, R49, R52, R53, . . . , R92, R93, if M=2). For example,assuming that all of the stored data D2, D3, D6, D7, . . . , D46, D47 inthe memory regions R2, R3, R6, R7, . . . , R46, R47 may be valid data,the stored data D2, D3, D6, D7, . . . , D46, D47 may be controlled tomigrate to the memory regions R48, R49, R52, R53, . . . , R92, R93, asshown in the left part of FIG. 4. With regard to the dual-channel mode,each memory address set may include two adjacent memory addresses thatmay be equally spaced by the same offset, where the offset may beadjusted, depending upon the actual design consideration. As a result, agroup of data D0, D1, D2, D3 may be accessed by using two differentmemory address sets, including one memory address set directed to memoryregions R0 and R1 and the other memory address set directed to thememory regions R48 and R49. Similarly, a group of data D4, D5, D6, D7may be accessed by using two different memory address sets, includingone memory address set directed to memory regions R4 and R5 and theother memory address set directed to the memory regions R52 and R53; anda group of data D44, D45, D46, D47 may be accessed by using twodifferent memory address sets, including one memory address set directedto memory regions R44 and R45 and the other memory address set directedto the memory regions R92 and R93.

Before the multi-channel memory device 102 is controlled to enter theM-channel mode (e.g., dual-channel mode with M=2), any of the highbandwidth engines 10 and the low bandwidth engines 12 may issueread/write requests for accessing a memory space that may be composed ofmemory regions R0-R47 and may be across the memory channels 109_1-109_4.In addition, when the multi-channel memory device 102 is controlled tooperate in the M-channel mode (e.g., dual-channel mode with M=2), any ofthe high bandwidth engines 10 and the low bandwidth engines 12 may issueread/write requests for accessing a memory space that may be composed ofmemory regions R0, R1, R4, R5, . . . , R92, R93 and may be across thememory channels 109_1 and 109_2. By way of example, but not limitation,a proposed sorting operation may be performed when the multi-channelmemory device 102 is in the N-channel mode (e.g., quad-channel mode withN=4), may be performed when the multi-channel memory device 102 is inthe M-channel mode (e.g., dual-channel mode with M=2), or may beperformed while the multi-channel memory device 102 is being switchedfrom the N-channel mode (e.g., quad-channel mode with N=4) to theM-channel mode (e.g., dual-channel mode with M=2). Hence, after, when orbefore the multi-channel memory device is controlled to operate in theM-channel mode, the proposed sorting operation may be performed to sortstored data of memory regions in a memory space according to a bandwidthrequirement order. To put it simply, the proposed sorting operation maybe performed at any time as long as it is done before the multi-channelmemory device 102 is switched from the M-channel mode (e.g.,dual-channel mode with M=2) to the N-channel mode (e.g., quad-channelmode with N=4). For clarity and simplicity, the following assumes thatthe proposed sorting operation may be performed when the multi-channelmemory device 102 is in the M-channel mode (e.g., dual-channel mode withM=2). However, this is for illustrative purposes only, and is not meantto be a limitation of the present invention.

In this embodiment, when the multi-channel memory device 102 iscontrolled to operate in the M-channel mode (e.g., dual-channel modewith M=2), the memory access controlling circuit 103 (particularly, DMAcontroller 106) may perform a sorting operation upon stored data ofmemory regions R0, R1, R4, R5, . . . , R92, R93 in the memory spaceacross the M memory channels 109_1, 109_2 used under the M-channel modeaccording to a bandwidth requirement order BR. For example, thebandwidth requirement order BR may be a descending order, such that amemory region addressed by a higher memory address may be controlled tostore data accessed by a high bandwidth engine and/or may have higheraccess frequency, and a memory region addressed by a lower memoryaddress may be controlled to store data accessed by a low bandwidthengine and/or may have lower access frequency. For another example, thebandwidth requirement order BR may be an ascending order, such that amemory region addressed by a higher memory address may be controlled tostore data accessed by a low bandwidth engine and/or may have loweraccess frequency, and a memory region addressed by a lower memoryaddress may be controlled to store data accessed by a high bandwidthengine and/or may have higher access frequency. To put it simply, thebandwidth requirement order BR may be adjusted, depending upon actualdesign considerations. In one example, the sorting operation can beperformed dynamically. In another example, the sorting operation can beperformed at least partially by any unit capable of running software.

For clarity and simplicity, the following assumes that the bandwidthrequirement order BR may be set by a descending order, as shown in theright part of FIG. 4. Hence, with regard to the memory regions R0, R1,R4, R5, . . . , R44, R45, the sorting operation performed by the DMAcontroller 106 may ensure that data accessed by high bandwidth engines10 and/or associated with higher access frequency is stored in memoryregions addressed by higher memory addresses and data accessed by lowbandwidth engines 12 and/or associated with lower access frequency isstored in memory regions addressed by lower memory addresses. Similarly,with regard to the memory regions R48, R49, R52, R53, . . . , R92, R93,the sorting operation performed by the DMA controller 106 may alsoensure that data accessed by high bandwidth engines 10 and/or associatedwith higher access frequency is stored in memory regions addressed byhigher memory addresses and data accessed by low bandwidth engines 12and/or associated with lower access frequency is stored in memoryregions addressed by lower memory addresses. For example, before thesoring operation is performed, one group of data D8, D9, D10, D11 storedin the memory regions R8, R9, R56, R57 and another group of data D12,D13, D14, D15 stored in the memory regions R12, R13, R60, R61 may beaccessed by one high bandwidth engine 10 and/or may be associated withhigher access frequency; and one group of data D28, D29, D30, D31 storedin the memory regions R28, R29, R76, R77 and another group of data D32,D33, D34, D35 stored in the memory regions R32, R33, R80, R81 may beaccessed by another high bandwidth engine 10 and/or may be associatedwith higher access frequency. After the sorting operation is performed,the group of data D8, D9, D10, D11 may be stored in the memory regionsR32, R33, R80, R81, the group of data D12, D13, D14, D15 may be storedin the memory regions R36, R37, R84, R85, the group of data D28, D29,D30, D31 may be stored in the memory regions R40, R41, R88, R89, and thegroup of data D32, D33, D34, D35 may be stored in the memory regionsR44, R45, R92, R93.

When the multi-channel memory device 102 is controlled to switch fromthe M-channel mode (e.g., dual-channel mode with M=2) to the N-channelmode (e.g., quad-channel mode with N=4), the memory access controllingcircuit 103 may control data of memory regions in a partial memory space(which may be composed of memory regions R48, R49, R52, R53, . . . ,R92, R93 and may be across M memory channels 109_1, 109_2 used under theM-channel mode, if M=2) to migrate to another partial memory space(which may be composed of memory regions R2, R3, R6, R7, . . . , R46,R47 and may be at L memory channels 109_3, 109_4 not used under theM-channel mode, if L=2). In this embodiment, the DMA controller 106 mayperform data migration upon memory regions in the partial memory space(which may be composed of memory regions R48, R49, R52, R53, . . . ,R92, R93 and may be across M memory channels 109_1, 109_2 used under theM-channel mode, if M=2) according to a predetermined memory addressorder MR of the memory regions R48, R49, R52, R53, . . . , R92, R93. Forexample, the aforementioned bandwidth requirement order BR may match thememory address order MR.

As shown in the right part of FIG. 5, the memory access controllingcircuit 103 (particularly, DMA controller 106) may perform datamigration upon data D34, D35 stored in the memory regions R92, R93 at afirst time point T1, may perform data migration upon data D30, D31stored in the memory regions R88, R89 at a second time point T2immediately following the first time point T1, may perform datamigration upon data D14, D15 stored in the memory regions R84, R85 at athird time point T3 immediately following the second time point T2, andmay perform data migration upon data D10, D11 stored in the memoryregions R80, R81 at a fourth time point T4 immediately following thethird time point T3. In this way, the high bandwidth requirement may besatisfied in a short time. For example, the high bandwidth engine mayget the desired memory bandwidth in a short time.

Each of the proposed memory management technique shown in FIG. 2, theproposed memory management technique shown in FIG. 3, and the proposedmemory management technique shown in FIGS. 4-5 may be employed to reducethe channel switch response time. In above exemplary embodiments, onlyone of the proposed memory management techniques is employed by a memorysystem. However, this is for illustrative purposes only, and is notmeant to be a limitation of the present invention. Alternatively, thememory system 100 may be modified to employ more than one proposedmemory management technique. For example, both of the proposed memorymanagement technique shown in FIG. 2 and the proposed memory managementtechnique shown in FIG. 3 may be employed in the same memory system. Foranother example, both of the proposed memory management technique shownin FIG. 2 and the proposed memory management technique shown in FIGS.4-5 may be employed in the same memory system. These alternative designsall fall within the scope of the present invention.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

The invention claimed is:
 1. A method for managing a multi-channelmemory device comprising: when the multi-channel memory device iscontrolled to operate in an M-channel mode, reserving a partial memoryspace across N memory channels of the multi-channel memory device,wherein the reserved partial memory space is not used under theM-channel mode, M and N are positive integers, and M is smaller than N;and when the multi-channel memory device is controlled to switch fromthe M-channel mode to an N-channel mode, accessing data in the reservedpartial memory space across the N memory channels used under theN-channel mode; wherein accessing data in the reserved partial memoryspace comprises: accessing data in the reserved partial memory spaceacross the N memory channels used under the N-channel mode while data ofa partial memory space at M memory channels used under the M-channelmode is controlled to migrate to a partial memory space at L memorychannels not used under the M-channel mode, wherein L is a positiveinteger, and the M memory channels and the L memory channels areincluded in the N memory channels.
 2. The method of claim 1, wherein thereserved partial memory space has no valid data stored therein when themulti-channel memory device is controlled to operate in the M-channelmode.
 3. The method of claim 1, wherein N is an integer multiple of M.4. The method of claim 1, wherein when the multi-channel memory deviceis controlled to switch from the M-channel mode to the N-channel mode,an engine first accesses old data in a partial memory space at the Mmemory channels, and then accesses new data in the reserved partialmemory space across the N memory channels.
 5. The method of claim 1,wherein when the multi-channel memory device is controlled to switchfrom the M-channel mode to the N-channel mode, a first engine isinstructed to access data in the reserved partial memory space acrossthe N memory channels, and a second engine is not instructed to accessdata in the reserved partial memory space across the N memory channels,where a bandwidth requirement of the first engine is higher than abandwidth requirement of the second engine.
 6. A method for managing amulti-channel memory device comprising: when the multi-channel memorydevice is controlled to switch from an M-channel mode to an N-channelmode, controlling data of at least one first memory region in a partialmemory space at M memory channels used under the M-channel mode tomigrate to a partial memory space at L memory channels not used underthe M-channel mode before controlling data of at least one second memoryregion in the partial memory space at the M memory channels used underthe M-channel mode to migrate to the partial memory space at the Lmemory channels not used under the M-channel mode; wherein M, L and Nare positive integers and M is smaller than N; and a bandwidthrequirement associated with the at least one first memory region ishigher than a bandwidth requirement associated with the at least onesecond memory region.
 7. The method of claim 6, wherein the M memorychannels and the L memory channels are included in N memory channelsused under the N-channel mode.
 8. The method of claim 6, furthercomprising: recording a memory address of the at least one first memoryregion under the M-channel mode; wherein controlling data of the atleast one first memory region in the partial memory space at the Mmemory channels used under the M-channel mode comprises: referring tothe recorded memory address of the at least one first memory region forperforming data migration upon the at least one first memory region inthe partial memory space at the M memory channels.
 9. The method ofclaim 6, further comprising: when or before the multi-channel memorydevice is controlled to operate in the M-channel mode, sorting storeddata of memory regions in a memory space according to a bandwidthrequirement order; wherein controlling data of the at least one firstmemory region in the partial memory space at the M memory channels usedunder the M-channel mode comprises: performing data migration uponmemory regions in the partial memory space at the M memory channelsaccording to a predetermined memory address order of the memory regions.10. A memory control system for managing a multi-channel memory devicecomprising: a mode controlling module, arranged to control themulti-channel memory device to operate in an M-channel mode and furtherarranged to control the multi-channel memory device to switch from theM-channel mode to an N-channel mode, wherein M and N are positiveintegers, and M is smaller than N; and a memory access controllingcircuit, wherein when the multi-channel memory device is controlled tooperate in the M-channel mode, the memory access controlling circuit isarranged to reserve a partial memory space across N memory channels ofthe multi-channel memory device, where the reserved partial memory spaceis not used under the M-channel mode; and when the multi-channel memorydevice is controlled to switch from the M-channel mode to the N-channelmode, the memory access controlling circuit is arranged to perform dataaccess in the reserved partial memory space across the N memory channelsused under the N-channel mode; wherein the memory access controllingcircuit performs data access in the reserved partial memory space acrossthe N memory channels used under the N-channel mode while controllingdata of a partial memory space at M memory channels used under theM-channel mode to migrate to a partial memory space at L memory channelsnot used under the M-channel mode, where L is a positive integer, andthe M memory channels and the L memory channels are included in the Nmemory channels.
 11. The memory control system of claim 10, wherein thereserved partial memory space has no valid data stored therein when themulti-channel memory device is controlled to operate in the M-channelmode.
 12. The memory control system of claim 10, wherein N is an integermultiple of M.
 13. The memory control system of claim 10, wherein whenthe multi-channel memory device is controlled to switch from theM-channel mode to the N-channel mode, an engine first accesses old datain a partial memory space at the M memory channels through the memoryaccess controlling circuit, and then accesses new data in the reservedpartial memory space across the N memory channels through the memoryaccess controlling circuit.
 14. The memory control system of claim 10,wherein when the multi-channel memory device is controlled to switchfrom the M-channel mode to the N-channel mode, the mode controllingmodule instructs a first engine to access data in the reserved partialmemory space across the N memory channels, and does not instruct asecond engine to access data in the reserved partial memory space acrossthe N memory channels, where a bandwidth requirement of the first engineis higher than a bandwidth requirement of the second engine.
 15. Amemory control system for managing a multi-channel memory devicecomprising: a mode controlling module, arranged to control themulti-channel memory device to switch from an M-channel mode to anN-channel mode, wherein M and N are positive integers, and M is smallerthan N; and a memory access controlling circuit, wherein when themulti-channel memory device is controlled to switch from the M-channelmode to the N-channel mode, the memory access controlling circuit isarranged to control data of at least one first memory region in apartial memory space at M memory channels used under the M-channel modeto migrate to a partial memory space at L memory channels not used underthe M-channel mode before controlling data of at least one second memoryregion in the partial memory space at the M memory channels used underthe M-channel mode to migrate to the partial memory space at the Lmemory channels not used under the M-channel mode, where L is a positiveinteger, and a bandwidth requirement associated with the at least onefirst memory region is higher than a bandwidth requirement associatedwith the at least one second memory region.
 16. The memory controlsystem of claim 15, wherein the M memory channels and the L memorychannels are included in N memory channels used under the N-channelmode.
 17. The memory control system of claim 15, wherein the memoryaccess controlling circuit is further arranged to record a memoryaddress of the at least one first memory region under the M-channelmode; and the memory access controlling circuit refers to the recordedmemory address of the at least one first memory region for performingdata migration upon the at least one first memory region in the partialmemory space at the M memory channels.
 18. The memory control system ofclaim 15, wherein when or before the multi-channel memory device iscontrolled to operate in the M-channel mode, the memory accesscontrolling circuit is further arranged to sort stored data of memoryregions in a memory space according to a bandwidth requirement order,where the memory access controlling circuit performs data migration uponmemory regions in the partial memory space at the M memory channelsaccording to a predetermined memory address order of the memory regions.